From d62bd07bf5e1769ed109d8ab65d4dbcf74a2e4a1 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Mon, 10 Dec 2007 11:55:55 +0000 Subject: [PATCH] x86: avoid LOCK prefix in some cases where it's not necessary. Signed-off-by: Jan Beulich --- xen/arch/x86/hvm/hvm.c | 2 +- xen/arch/x86/hvm/vlapic.c | 2 +- xen/arch/x86/traps.c | 16 ++++++++-------- xen/common/page_alloc.c | 5 +++-- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 0fbbd12d9e..854e58040e 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -81,7 +81,7 @@ void hvm_enable(struct hvm_function_table *fns) * delays, but the vmexits simply slow things down). */ memset(hvm_io_bitmap, ~0, sizeof(hvm_io_bitmap)); - clear_bit(0x80, hvm_io_bitmap); + __clear_bit(0x80, hvm_io_bitmap); hvm_funcs = *fns; hvm_enabled = 1; diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c index 3d27d46840..5ac455b1fe 100644 --- a/xen/arch/x86/hvm/vlapic.c +++ b/xen/arch/x86/hvm/vlapic.c @@ -408,7 +408,7 @@ static void vlapic_ipi(struct vlapic *vlapic) if ( vlapic_match_dest(v, vlapic, short_hand, dest, dest_mode) ) { if ( delivery_mode == APIC_DM_LOWEST ) - set_bit(v->vcpu_id, &lpr_map); + __set_bit(v->vcpu_id, &lpr_map); else vlapic_accept_irq(v, delivery_mode, vector, level, trig_mode); diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 80d989733b..9cc1669116 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -677,25 +677,25 @@ static int emulate_forced_invalid_op(struct cpu_user_regs *regs) if ( regs->eax == 1 ) { /* Modify Feature Information. */ - clear_bit(X86_FEATURE_VME, &d); - clear_bit(X86_FEATURE_PSE, &d); - clear_bit(X86_FEATURE_PGE, &d); + __clear_bit(X86_FEATURE_VME, &d); + __clear_bit(X86_FEATURE_PSE, &d); + __clear_bit(X86_FEATURE_PGE, &d); if ( !cpu_has_sep ) - clear_bit(X86_FEATURE_SEP, &d); + __clear_bit(X86_FEATURE_SEP, &d); #ifdef __i386__ if ( !supervisor_mode_kernel ) - clear_bit(X86_FEATURE_SEP, &d); + __clear_bit(X86_FEATURE_SEP, &d); #endif if ( !IS_PRIV(current->domain) ) - clear_bit(X86_FEATURE_MTRR, &d); + __clear_bit(X86_FEATURE_MTRR, &d); } else if ( regs->eax == 0x80000001 ) { /* Modify Feature Information. */ #ifdef __i386__ - clear_bit(X86_FEATURE_SYSCALL % 32, &d); + __clear_bit(X86_FEATURE_SYSCALL % 32, &d); #endif - clear_bit(X86_FEATURE_RDTSCP % 32, &d); + __clear_bit(X86_FEATURE_RDTSCP % 32, &d); } else { diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 4c723e5d27..2d5f3f6da3 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -301,14 +301,15 @@ static void init_node_heap(int node) /* First node to be discovered has its heap metadata statically alloced. */ static heap_by_zone_and_order_t _heap_static; static unsigned long avail_static[NR_ZONES]; - static unsigned long first_node_initialised; + static int first_node_initialised; int i, j; - if ( !test_and_set_bit(0, &first_node_initialised) ) + if ( !first_node_initialised ) { _heap[node] = &_heap_static; avail[node] = avail_static; + first_node_initialised = 1; } else { -- 2.30.2